import { request } from '@/utils'
import { AxiosPromise } from 'axios'

// 登录
function login(mobile: string, code: string) {
    return request({
        url: '/authorizations',
        method: 'post',
        data: {
            mobile,
            code
        }
    })
}
export type UserInfo = {
    birthday: string,
    gender: number,
    id: string,
    mobile: string,
    name: string,
    photo: string
}

function userInfo(): AxiosPromise<{ data: UserInfo }> {
    return request({
        url: '/user/profile',
        method: 'get'
    })
}



export { login, userInfo }